#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;

double xx1, yy1, rr1;
double xx2, yy2, rr2;
double cc1, cc2, dis2, dis;
double area1, area, rr;
int main()
{
	while (scanf("%lf%lf%lf%lf%lf%lf", &xx1, &yy1, &rr1,&xx2 ,&yy2, &rr2)!=EOF)
	{
	    dis2 = ((xx1-xx2)*(xx1-xx2)+(yy1-yy2)*(yy1-yy2));
	    dis = sqrt( dis2 );
	    if ( (dis-rr1-rr2)>1e-8)
	    {
	        printf("0.000\n");
	        continue;
	    }
     	if ( fabs( dis-rr1-rr2)<1e-8)
      	{
      	    printf("0.000\n");
	        continue;
      	}	        
      	if ( fabs(rr1-rr2)< dis && (rr1+rr2)> dis)
      	{
            cc1 = acos( (rr1*rr1+dis2 - rr2*rr2)/(2*rr1*dis) );
    	    cc2 = acos( (rr2*rr2+dis2 - rr1*rr1)/(2*rr2*dis) );
    	    area1 = rr1*dis*sin(cc1);
    	    cc1 *=2;
    	    cc2 *=2;	    
    	    area = cc1*rr1*rr1/2 + cc2*rr2*rr2/2;
    	    printf("%.3lf\n", area-area1);
    	    continue;
    	}
     	else 
     	{
     	    rr= rr1<rr2? rr1:rr2;
     	    area = asin(1.0)*2*rr*rr;
     	    printf("%.3lf\n", area);     	    
     	}    
	    
	    
	}    
    
    return 0;
}    